package com.primaryedu.data;

import java.util.ArrayList;
import java.util.List;

import com.primaryedu.bean.AccountBean;
import com.primaryedu.bean.HomenewsBean;
import com.primaryedu.bean.ProvinceBean;
import com.primaryedu.bean.RepairBean;

import android.content.Context;

public class GlobalData {

    public static AccountBean accountBean = new AccountBean();

    public static int widthPixels = 0;
    public static int heightPixels = 0;

    // 首页轮滑广告的个数
    public static int GALLERY_SIZE = 4;

    public static List<HomenewsBean.DataBean.ListBean> newsLists = new ArrayList<>();

    /**
     * 返回当前用户的手机号
     */
    @SuppressWarnings("static-access")
    public static String getUserId(Context context) {
        AppSharedPreferences sharedPreferences = new AppSharedPreferences(
                context, Contants.account);
        return sharedPreferences.getString(Contants.userId, "");
    }

    public static String getClassname(Context context) {
        AppSharedPreferences sharedPreferences = new AppSharedPreferences(
                context, Contants.account);
        return sharedPreferences.getString(Contants.classname, "");
    }

    public static String getClassid(Context context) {
        AppSharedPreferences sharedPreferences = new AppSharedPreferences(
                context, Contants.account);
        return sharedPreferences.getString(Contants.classid, "");
    }

    public static String getUsertype(Context context) {
        AppSharedPreferences sharedPreferences = new AppSharedPreferences(
                context, Contants.account);
        return sharedPreferences.getString(Contants.usertype, "");
    }

    public static String getUsername(Context context) {
        AppSharedPreferences sharedPreferences = new AppSharedPreferences(
                context, Contants.account);
        return sharedPreferences.getString(Contants.username, "");
    }

    public static String getUserNickname(Context context) {
        AppSharedPreferences sharedPreferences = new AppSharedPreferences(
                context, Contants.account);
        return sharedPreferences.getString(Contants.usernickname, "");
    }

    public static String getUserphotourl(Context context) {
        AppSharedPreferences sharedPreferences = new AppSharedPreferences(
                context, Contants.account);
        return sharedPreferences.getString(Contants.userphotourl, "");
    }

    public static String getSerial(Context context) {
        AppSharedPreferences sharedPreferences = new AppSharedPreferences(
                context, Contants.account);
        return sharedPreferences.getString(Contants.serial, "");
    }
    /**
     * 保存用户是否是首次设置个人信息
     */
    @SuppressWarnings("static-access")
    public static void saveUserId(Context context, String params) {
        AppSharedPreferences sharedPreferences = new AppSharedPreferences(
                context, Contants.account);
        sharedPreferences.commit(Contants.userId, params);
    }

    public static void saveClassname(Context context, String params) {
        AppSharedPreferences sharedPreferences = new AppSharedPreferences(
                context, Contants.account);
        sharedPreferences.commit(Contants.classname, params);
    }

    public static void saveClassid(Context context, String params) {
        AppSharedPreferences sharedPreferences = new AppSharedPreferences(
                context, Contants.account);
        sharedPreferences.commit(Contants.classid, params);
    }

    public static void saveUsertype(Context context, String params) {
        AppSharedPreferences sharedPreferences = new AppSharedPreferences(
                context, Contants.account);
        sharedPreferences.commit(Contants.usertype, params);
    }

    public static void saveUsername(Context context, String params) {
        AppSharedPreferences sharedPreferences = new AppSharedPreferences(
                context, Contants.account);
        sharedPreferences.commit(Contants.username, params);
    }

    public static void saveUserNickname(Context context, String params) {
        AppSharedPreferences sharedPreferences = new AppSharedPreferences(
                context, Contants.account);
        sharedPreferences.commit(Contants.usernickname, params);
    }

    public static void saveUserphotourl(Context context, String params) {
        AppSharedPreferences sharedPreferences = new AppSharedPreferences(
                context, Contants.account);
        sharedPreferences.commit(Contants.userphotourl, params);
    }

    public static void saveSerial(Context context, String params) {
        AppSharedPreferences sharedPreferences = new AppSharedPreferences(
                context, Contants.account);
        sharedPreferences.commit(Contants.serial, params);
    }
    /**
     * 保存用户是否是首次设置个人信息
     */
    @SuppressWarnings("static-access")
    public static void saveFirst(Context context, String params) {
        AppSharedPreferences sharedPreferences = new AppSharedPreferences(
                context, Contants.account);
        sharedPreferences.commit(Contants.firstSetInfo, params);
    }

    // 省份列表信息
    public static List<ProvinceBean> provinceLists = new ArrayList<ProvinceBean>();

    // 当前经纬度
    public static String Latitude = "";
    public static String Longitude = "";

    // 当前地理信息
    public static String loc_address = "";

    // 南京市鼓楼区中山北路408号
    public static double nanjingHightlng = 118.75128264025874;
    public static double nanjingHightlat = 32.08504471361549;

    // 江苏省南京市鼓楼区大桥南路16号  32.0947320000,118.7616780000
    public static double nanjingHightlngTwo = 118.7616780000;
    public static double nanjingHightlatTwo = 32.0947320000;

    public static RepairBean repairBean = new RepairBean();


}
